home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_5 / issue_06 / benchmarks / c_source / rmath < prev    next >
Encoding:
Text File  |  1991-09-15  |  468 b   |  25 lines

  1. /* realmath */
  2.  
  3. #include <stdio.h>
  4. #include <time2.h>
  5.  
  6.  
  7. main()
  8. {
  9.         int i;
  10.         float x,y;
  11.     clock_t start, end;
  12.  
  13.     start=clock();
  14.  
  15.         x = 0.0;
  16.         y = 9.9;
  17.         printf("start\n");
  18.         for (i=0;i<1000;i++)
  19.             x = x + (y*y-y)/y;
  20.     end=clock();
  21.     printf("Finish %f \n",x);
  22.     printf("The timing for this RMATH test, \n");
  23.     printf("which tests floating point multiplication performance, was: %f \n", (end-start) / CLK_TCK);
  24. }
  25.